<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="Cache-Control" content="max-age=7200" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>javascript</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box
    }
    body {
      font-size: 14px;
      padding: 20px;
    }
    ul li {
      line-height: 30px;
    }
  </style>
</head>
<body>
  <ul onclick="go(event)">
    <li>1</li>
    <li onclick="goto(event)">2</li>
    <li>3</li>
  </ul>
</body>
<script>
  function go(event) {
    console.log(2, event)
  }
  function goto(event) {
    event.stopPropagation()
    console.log(1, event)
  }
    // const ulDom = document.querySelector('ul');
    // ulDom.addEventListener('click', function(e) {
    //   alert(1)
    // }, false)
    // ulDom.addEventListener('click', function(e) {
    //     alert(2)
    //     if (e.target && e.target.nodeName.toLowerCase() === 'li') {
    //         console.log(e.target.innerHTML)
    //     }
    // }, false)

</script>
</html>